<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var year = Number(prompt('请输入年份'));
        var month = Number(prompt('请输入月份'));
        var day;
        switch(month){
            case 12:
            case 10:
            case 8:
            case 7:
            case 5:
            case 3:
            case 1:
                alert('31天')
            break;
            case 11:
            case 9:
            case 6:
            case 4:
                alert('30天');
            break;
            case 2:
                if(year%4==0 && year%100!=0 ||year%400==0){
                    alert('29天');
                }else{
                    alert('28天');
                }  
            break;
        }
    </script>
</body>
</html>